webpackJsonp([39],{

/***/ "jy4Q":
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),

/***/ "l/Gd":
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });

// EXTERNAL MODULE: ./node_modules/_babel-runtime@6.26.0@babel-runtime/regenerator/index.js
var regenerator = __webpack_require__("lC5x");
var regenerator_default = /*#__PURE__*/__webpack_require__.n(regenerator);

// EXTERNAL MODULE: ./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/asyncToGenerator.js
var asyncToGenerator = __webpack_require__("J0Oq");
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);

// EXTERNAL MODULE: ./node_modules/_babel-runtime@6.26.0@babel-runtime/helpers/extends.js
var helpers_extends = __webpack_require__("4YfN");
var extends_default = /*#__PURE__*/__webpack_require__.n(helpers_extends);

// EXTERNAL MODULE: ./src/store/index.js
var store = __webpack_require__("IcnI");

// EXTERNAL MODULE: ./src/common/utils/index.js
var utils = __webpack_require__("dh3M");

// EXTERNAL MODULE: ./src/common/api/commonApi.js
var commonApi = __webpack_require__("+/+p");

// EXTERNAL MODULE: ./src/common/plugin/index.js + 207 modules
var common_plugin = __webpack_require__("Tvds");

// CONCATENATED MODULE: ./node_modules/_babel-loader@7.1.5@babel-loader/lib!./node_modules/_vue-loader@13.7.3@vue-loader/lib/selector.js?type=script&index=0!./src/common/anjian/law/detain.vue



//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//






/* harmony default export */ var detain = ({
  data: function data() {
    var _this = this;

    return {
      enterpriseName: '',
      form: {},
      userList: [],
      items: [{
        type: 'red',
        text: '删除',
        confirmText: '确定删除',
        confirm: function confirm(index) {
          _this.form.troubles.splice(index, 1);
        }
      }],
      items2: [{
        type: 'red',
        text: '删除',
        confirmText: '确定删除',
        confirm: function confirm(index) {
          _this.form.solutions.splice(index, 1);
        }
      }]
    };
  },
  created: function created() {
    var _this2 = this;

    store["a" /* BUS */].$on(store["b" /* EVENTS */].lawDetainHidden, function (list) {
      _this2.form = extends_default()({}, _this2.form, { troubles: list });
    });
    store["a" /* BUS */].$on(store["b" /* EVENTS */].lawDetainContent, function (list) {
      _this2.form = extends_default()({}, _this2.form, { solutions: list });
    });
    store["a" /* BUS */].$on(store["b" /* EVENTS */].lawDetainList, function (list) {
      _this2.form = extends_default()({}, _this2.form, { detains: list });
    });
  },

  methods: {
    goList: function goList() {
      this.$router.$push({
        path: '/law/detain/list',
        query: { data: this.form.detains }
      });
    },
    goHidden: function goHidden() {
      this.$router.$push({
        path: '/law/detain/hidden',
        query: { data: this.form.troubles }
      });
    },
    goContent: function goContent() {
      this.$router.$push({
        path: '/law/detain/content',
        query: { data: this.form.solutions }
      });
    },
    init: function init() {
      var _this3 = this;

      return asyncToGenerator_default()( /*#__PURE__*/regenerator_default.a.mark(function _callee() {
        var form, _ref, D0006;

        return regenerator_default.a.wrap(function _callee$(_context) {
          while (1) {
            switch (_context.prev = _context.next) {
              case 0:
                _this3.id = _this3.$route.query.id;
                _context.next = 3;
                return commonApi["a" /* commonApi */].searchFirst('law_detain', {
                  equalTo: { law_plan: _this3.id },
                  include: ['ent_id']
                });

              case 3:
                form = _context.sent;

                _this3.form = form ? Object(utils["c" /* PointerToString */])(form, ['check_person:array']) : {};

                if (!_this3.form.document_num) {
                  _context.next = 7;
                  break;
                }

                return _context.abrupt('return');

              case 7:
                _context.next = 9;
                return commonApi["a" /* commonApi */].runCloud('lawGetDocumentNum', {
                  year: new Date().getFullYear()
                });

              case 9:
                _ref = _context.sent;
                D0006 = _ref.D0006;

                _this3.form = extends_default()({}, _this3.form, { document_num: D0006 });

              case 12:
              case 'end':
                return _context.stop();
            }
          }
        }, _callee, _this3);
      }))();
    },
    fetchData: function fetchData() {
      var _this4 = this;

      return asyncToGenerator_default()( /*#__PURE__*/regenerator_default.a.mark(function _callee2() {
        return regenerator_default.a.wrap(function _callee2$(_context2) {
          while (1) {
            switch (_context2.prev = _context2.next) {
              case 0:
                _context2.next = 2;
                return commonApi["a" /* commonApi */].search('aj_organization_personnel', {
                  include: ['OrganizationIds'],
                  matchesQuery: {
                    OrganizationIds: commonApi["a" /* commonApi */].createQueryIncludeOptions('sys_organizations', {
                      equalTo: {
                        Name: '安监局执法'
                      }
                    })
                  }
                });

              case 2:
                _this4.userList = _context2.sent;

              case 3:
              case 'end':
                return _context2.stop();
            }
          }
        }, _callee2, _this4);
      }))();
    },
    onSubmit: function onSubmit(loaded) {
      var _this5 = this;

      return asyncToGenerator_default()( /*#__PURE__*/regenerator_default.a.mark(function _callee3() {
        var _$route$query, id, enterprise, form;

        return regenerator_default.a.wrap(function _callee3$(_context3) {
          while (1) {
            switch (_context3.prev = _context3.next) {
              case 0:
                _context3.prev = 0;
                _$route$query = _this5.$route.query, id = _$route$query.id, enterprise = _$route$query.enterprise;
                form = extends_default()({}, _this5.form, { ent_id: enterprise, law_plan: id });

                form = Object(utils["a" /* BuildPointer */])(form, {
                  check_person: 'aj_organization_personnel',
                  ent_id: 'ent_enterprise',
                  law_plan: 'law_plan'
                });
                _context3.next = 6;
                return commonApi["a" /* commonApi */].save('law_detain', form);

              case 6:
                _this5.$router.$back();
                _this5.$Toast('提交成功!', 'success');
                _context3.next = 13;
                break;

              case 10:
                _context3.prev = 10;
                _context3.t0 = _context3['catch'](0);

                _this5.$Toast('提交失败!', 'error');

              case 13:
                loaded();

              case 14:
              case 'end':
                return _context3.stop();
            }
          }
        }, _callee3, _this5, [[0, 10]]);
      }))();
    },
    onPreview: function onPreview(loaded) {
      var _this6 = this;

      return asyncToGenerator_default()( /*#__PURE__*/regenerator_default.a.mark(function _callee4() {
        var word, _ref2, url;

        return regenerator_default.a.wrap(function _callee4$(_context4) {
          while (1) {
            switch (_context4.prev = _context4.next) {
              case 0:
                _context4.prev = 0;
                _context4.next = 3;
                return commonApi["a" /* commonApi */].runCloud('officeCopy', {
                  code: 'D0001',
                  data: _this6.$route.query.id
                });

              case 3:
                word = _context4.sent;
                _context4.next = 6;
                return commonApi["a" /* commonApi */].runCloud('WordToPdf', { word: word });

              case 6:
                _ref2 = _context4.sent;
                url = _ref2.url;

                if (url) {
                  _context4.next = 12;
                  break;
                }

                _this6.$Toast('文件转换失败，请尝试重新预览！', 'error');
                loaded();
                return _context4.abrupt('return');

              case 12:
                common_plugin["b" /* bridge */].PreviewPdf({ title: '文件标题', url: url });
                _context4.next = 17;
                break;

              case 15:
                _context4.prev = 15;
                _context4.t0 = _context4['catch'](0);

              case 17:
                loaded();

              case 18:
              case 'end':
                return _context4.stop();
            }
          }
        }, _callee4, _this6, [[0, 15]]);
      }))();
    }
  },
  activated: function activated() {
    var _this7 = this;

    return asyncToGenerator_default()( /*#__PURE__*/regenerator_default.a.mark(function _callee5() {
      return regenerator_default.a.wrap(function _callee5$(_context5) {
        while (1) {
          switch (_context5.prev = _context5.next) {
            case 0:
              _this7.enterpriseName = _this7.$route.query.enterpriseName;
              if (!_this7.$router.$isBack) {
                _this7.init();
                _this7.fetchData();
              }

            case 2:
            case 'end':
              return _context5.stop();
          }
        }
      }, _callee5, _this7);
    }))();
  }
});
// CONCATENATED MODULE: ./node_modules/_vue-loader@13.7.3@vue-loader/lib/template-compiler?{"id":"data-v-62d73702","hasScoped":true,"transformToRequire":{"video":["src","poster"],"source":"src","img":"src","image":"xlink:href"},"buble":{"transforms":{}}}!./node_modules/_vue-loader@13.7.3@vue-loader/lib/selector.js?type=template&index=0!./src/common/anjian/law/detain.vue
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('yt-page',{attrs:{"title":"查封扣押处置"}},[_c('yt-form',[_c('yt-card',{attrs:{"title":"基本信息"}},[_c('yt-cell',{attrs:{"label":"文书编号"}},[_c('yt-input',{attrs:{"clearable":false},model:{value:(_vm.form.document_num),callback:function ($$v) {_vm.$set(_vm.form, "document_num", $$v)},expression:"form.document_num"}})],1),_vm._v(" "),_c('yt-cell',{attrs:{"label":"被检查企业","value":_vm.enterpriseName}}),_vm._v(" "),_c('yt-cell',{attrs:{"label":"检查日期"}},[_c('yt-cell-time',{model:{value:(_vm.form.check_date),callback:function ($$v) {_vm.$set(_vm.form, "check_date", $$v)},expression:"form.check_date"}})],1),_vm._v(" "),_c('yt-cell',{attrs:{"label":"执法人员"}},[_c('yt-cell-select',{attrs:{"list":_vm.userList,"max":2,"val":"id","label":"DisplayName"},model:{value:(_vm.form.check_person),callback:function ($$v) {_vm.$set(_vm.form, "check_person", $$v)},expression:"form.check_person"}})],1),_vm._v(" "),_c('yt-cell',{attrs:{"label":"扣押开始日期","labelWidth":"100px"}},[_c('yt-cell-time',{model:{value:(_vm.form.start_date),callback:function ($$v) {_vm.$set(_vm.form, "start_date", $$v)},expression:"form.start_date"}})],1),_vm._v(" "),_c('yt-cell',{attrs:{"label":"扣押结束日期","labelWidth":"100px"}},[_c('yt-cell-time',{model:{value:(_vm.form.end_date),callback:function ($$v) {_vm.$set(_vm.form, "end_date", $$v)},expression:"form.end_date"}})],1),_vm._v(" "),_c('yt-cell',{attrs:{"label":"处理依据法规","labelWidth":"100px","border":"none"}},[_c('yt-input',{attrs:{"clearable":false},model:{value:(_vm.form.dep_law),callback:function ($$v) {_vm.$set(_vm.form, "dep_law", $$v)},expression:"form.dep_law"}})],1)],1),_vm._v(" "),_c('yt-card',{attrs:{"title":"存在隐患","btn":"添加隐患内容"},on:{"btn-click":_vm.goHidden}},_vm._l((_vm.form.troubles),function(item,index){return _c('yt-cellSwipe',{key:index,attrs:{"data":index,"items":_vm.items}},[_c('p',{staticClass:"row"},[_vm._v(_vm._s(index + 1)+"："+_vm._s(item))])])}),1),_vm._v(" "),_c('yt-card',{attrs:{"title":"处理决定","btn":"添处理内容"},on:{"btn-click":_vm.goContent}},_vm._l((_vm.form.solutions),function(item,index){return _c('yt-cellSwipe',{key:index,attrs:{"data":index,"items":_vm.items2}},[_c('p',{staticClass:"row"},[_vm._v(_vm._s(index + 1)+"："+_vm._s(item))])])}),1),_vm._v(" "),_c('yt-card',{attrs:{"title":"扣押清单","btn":"添加扣押清单"},on:{"btn-click":_vm.goList}},[_c('yt-cell',{attrs:{"label":"扣押文号","border":"none"}},[_c('yt-input',{attrs:{"clearable":false},model:{value:(_vm.form.detain_num),callback:function ($$v) {_vm.$set(_vm.form, "detain_num", $$v)},expression:"form.detain_num"}})],1),_vm._v(" "),_vm._l((_vm.form.detains),function(item,index){return _c('yt-cellSwipe',{key:index,attrs:{"data":index,"items":_vm.items2}},[_c('p',{staticClass:"row"},[_vm._v(_vm._s(index + 1)+"："+_vm._s(item.name))])])})],2),_vm._v(" "),(!_vm.form.id)?_c('yt-btn',{attrs:{"slot":"btn","loading":_vm.onSubmit,"theme":"blue","edge":""},slot:"btn"},[_vm._v("保存")]):_c('yt-btn-group',{attrs:{"slot":"btn","edge":""},slot:"btn"},[_c('yt-btn',{attrs:{"theme":"white","loading":_vm.onPreview,"loadingOption":{color: '#46baff'}}},[_vm._v("预览文书")]),_vm._v(" "),_c('yt-btn',{attrs:{"theme":"white","loading":_vm.onSubmit,"loadingOption":{color: '#46baff'}}},[_vm._v("保存")])],1)],1)],1)}
var staticRenderFns = []
var esExports = { render: render, staticRenderFns: staticRenderFns }
/* harmony default export */ var law_detain = (esExports);
// CONCATENATED MODULE: ./src/common/anjian/law/detain.vue
function injectStyle (ssrContext) {
  __webpack_require__("jy4Q")
}
var normalizeComponent = __webpack_require__("C7Lr")
/* script */


/* template */

/* template functional */
var __vue_template_functional__ = false
/* styles */
var __vue_styles__ = injectStyle
/* scopeId */
var __vue_scopeId__ = "data-v-62d73702"
/* moduleIdentifier (server only) */
var __vue_module_identifier__ = null
var Component = normalizeComponent(
  detain,
  law_detain,
  __vue_template_functional__,
  __vue_styles__,
  __vue_scopeId__,
  __vue_module_identifier__
)

/* harmony default export */ var anjian_law_detain = __webpack_exports__["default"] = (Component.exports);


/***/ })

});